/*
** Copyright (C) 2010 Calin Radoni
**
** This file is part of CHScanner.
**
** CHScanner is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** CHScanner is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with CHScanner. If not, see <http://www.gnu.org/licenses/>.
*/

#include "StdAfx.h"
#include ".\mmsgdisplay.h"

//---------------------------------------------------------------------------

MMsgDisplay::MMsgDisplay(void)
{
	dlgMsg = NULL;
}

MMsgDisplay::~MMsgDisplay(void)
{
}

//---------------------------------------------------------------------------

int MMsgDisplay::DisplayMessageBox(CString strIn, UINT typeIn)
{
	int res;

	res = AfxMessageBox(strIn, typeIn);
	return res;
}

int MMsgDisplay::DisplayMessageBoxById(int idIn, UINT typeIn)
{
	CString str;

	str = translator.GetString(idIn);
	return DisplayMessageBox(str, typeIn);
}

//---------------------------------------------------------------------------

bool MMsgDisplay::DisplayStatusMessage(CString strIn)
{
	if(dlgMsg==NULL){
		DisplayMessageBox(strIn, MB_OK);
		return true;
	}

	return dlgMsg->AddMessage(strIn);
}

bool MMsgDisplay::DisplayStatusMessage(int idIn)
{
	CString str;

	str = translator.GetString(idIn);
	return DisplayStatusMessage(str);
}

bool MMsgDisplay::DisplayStatusMessageWithParam(int idIn, int paramIn)
{
	CString str;

	str = translator.GetStringWithParam(idIn, paramIn);
	return DisplayStatusMessage(str);
}

bool MMsgDisplay::DisplayStatusMessageWithParamS(int idIn, CString strIn)
{
	CString str;

	str = translator.GetStringWithParamS(idIn, strIn);
	return DisplayStatusMessage(str);
}

bool MMsgDisplay::DisplayStatusMessageWithParamSS(int idIn, CString strIn1, CString strIn2)
{
	CString str;

	str = translator.GetStringWithParamSS(idIn, strIn1, strIn2);
	return DisplayStatusMessage(str);
}

bool MMsgDisplay::DisplayStatusMessageForMsg(UINT msgIn, WPARAM wpIn, LPARAM lpIn)
{
	CString str;

	str = translator.GetStringForMessage(msgIn, wpIn, lpIn);
	return DisplayStatusMessage(str);
}

//---------------------------------------------------------------------------

CString MMsgDisplay::GetTime(DWORD dwIn)
{
	return translator.GetTime(dwIn);
}

//---------------------------------------------------------------------------
